Skip to content

feat(core): Expose pauseAppHangTracking and resumeAppHangTracking APIs#6192

Merged
antonis merged 4 commits into
mainfrom
antonis/expose-pause-resume-app-hang-tracking
May 21, 2026
Merged

feat(core): Expose pauseAppHangTracking and resumeAppHangTracking APIs#6192
antonis merged 4 commits into
mainfrom
antonis/expose-pause-resume-app-hang-tracking

Conversation

@antonis
Copy link
Copy Markdown
Contributor

@antonis antonis commented May 20, 2026

📢 Type of change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring

📜 Description

Exposes the Cocoa SDK's SentrySDK.pauseAppHangTracking() and SentrySDK.resumeAppHangTracking() APIs to React Native users.

These methods allow temporarily pausing app hang detection — useful when showing system dialogs (e.g., permission prompts) that block the main thread but are not real hangs.

  • iOS: calls through to SentrySDK via SentrySDKWrapper
  • Android: no-op (app hang tracking is iOS-only; required by TurboModule spec)

New public API:

import { pauseAppHangTracking, resumeAppHangTracking } from '@sentry/react-native';

pauseAppHangTracking();
// ... show system dialog ...
resumeAppHangTracking();

💡 Motivation and Context

Closes #3909

The Cocoa SDK added pauseAppHangTracking / resumeAppHangTracking in v8.30.0 (we depend on 9.13.0). Without this, the SDK reports false-positive app hangs when the OS shows system dialogs that block the main thread.

💚 How did you test it?

  • Added wrapper unit tests (enabled/disabled paths)
  • All existing tests pass
  • Build, lint, circular dep check, and API report all green

📝 Checklist

🔮 Next steps

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 20, 2026

Semver Impact of This PR

None (no version bump detected)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


  • feat(core): Expose pauseAppHangTracking and resumeAppHangTracking APIs by antonis in #6192

🤖 This preview updates automatically when you update the PR.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 20, 2026

Fails
🚫 Pull request is not ready for merge, please add the "ready-to-merge" label to the pull request
Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against a7e3801

@antonis antonis force-pushed the antonis/expose-pause-resume-app-hang-tracking branch from 6865866 to d8e8338 Compare May 20, 2026 11:56
@antonis
Copy link
Copy Markdown
Contributor Author

antonis commented May 20, 2026

@sentry review

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit d8e8338. Configure here.

Comment thread packages/core/test/wrapper.test.ts
@antonis antonis force-pushed the antonis/expose-pause-resume-app-hang-tracking branch from d8e8338 to 0e6bfda Compare May 20, 2026 12:09
@antonis antonis added the ready-to-merge Triggers the full CI test suite label May 20, 2026
Comment thread packages/core/etc/sentry-react-native.api.md
@antonis antonis force-pushed the antonis/expose-pause-resume-app-hang-tracking branch from b86481d to eb6f266 Compare May 20, 2026 12:37
@sentry
Copy link
Copy Markdown

sentry Bot commented May 20, 2026

📲 Install Builds

Android

🔗 App Name App ID Version Configuration
Sentry RN io.sentry.reactnative.sample 8.11.1 (88) Release

⚙️ sentry-react-native Build Distribution Settings

@antonis antonis marked this pull request as ready for review May 20, 2026 12:38
@github-actions
Copy link
Copy Markdown
Contributor

Android (legacy) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 413.21 ms 453.65 ms 40.44 ms
Size 48.30 MiB 53.54 MiB 5.24 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
3817909+dirty 406.67 ms 416.58 ms 9.91 ms
4b87b12+dirty 421.82 ms 413.60 ms -8.22 ms
df5d108+dirty 527.06 ms 603.58 ms 76.52 ms
71abba0+dirty 496.54 ms 525.16 ms 28.63 ms
890d145+dirty 504.54 ms 491.55 ms -12.99 ms
23598c3+dirty 414.12 ms 426.24 ms 12.12 ms
44c8b3f+dirty 414.20 ms 457.28 ms 43.08 ms
3b6e9f9+dirty 442.70 ms 486.44 ms 43.74 ms
7ac3378+dirty 404.78 ms 439.84 ms 35.06 ms
1122a96+dirty 422.22 ms 464.33 ms 42.10 ms

App size

Revision Plain With Sentry Diff
3817909+dirty 43.75 MiB 48.08 MiB 4.33 MiB
4b87b12+dirty 43.75 MiB 48.14 MiB 4.39 MiB
df5d108+dirty 43.75 MiB 48.08 MiB 4.33 MiB
71abba0+dirty 48.30 MiB 53.49 MiB 5.19 MiB
890d145+dirty 43.75 MiB 48.14 MiB 4.39 MiB
23598c3+dirty 43.75 MiB 48.16 MiB 4.41 MiB
44c8b3f+dirty 48.30 MiB 53.46 MiB 5.15 MiB
3b6e9f9+dirty 48.30 MiB 53.54 MiB 5.23 MiB
7ac3378+dirty 43.75 MiB 48.13 MiB 4.37 MiB
1122a96+dirty 48.30 MiB 53.54 MiB 5.24 MiB

@github-actions
Copy link
Copy Markdown
Contributor

iOS (legacy) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 3847.17 ms 1221.44 ms -2625.72 ms
Size 5.15 MiB 6.68 MiB 1.53 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
1122a96+dirty 3823.10 ms 1218.64 ms -2604.46 ms
4b87b12+dirty 1212.90 ms 1222.09 ms 9.19 ms
8929511+dirty 1216.42 ms 1219.02 ms 2.60 ms
a0d8cf8+dirty 3842.33 ms 1212.40 ms -2629.93 ms
5c1e987+dirty 1204.30 ms 1222.15 ms 17.85 ms
6177334+dirty 3834.85 ms 1217.58 ms -2617.28 ms
7d6fd3a+dirty 1223.29 ms 1229.57 ms 6.28 ms
71abba0+dirty 3821.93 ms 1202.81 ms -2619.12 ms
3b6e9f9+dirty 3851.90 ms 1233.33 ms -2618.57 ms
2c735cc+dirty 1229.67 ms 1221.50 ms -8.17 ms

App size

Revision Plain With Sentry Diff
1122a96+dirty 5.15 MiB 6.68 MiB 1.53 MiB
4b87b12+dirty 3.38 MiB 4.77 MiB 1.39 MiB
8929511+dirty 3.38 MiB 4.80 MiB 1.42 MiB
a0d8cf8+dirty 5.15 MiB 6.67 MiB 1.51 MiB
5c1e987+dirty 3.38 MiB 4.73 MiB 1.35 MiB
6177334+dirty 5.15 MiB 6.68 MiB 1.53 MiB
7d6fd3a+dirty 3.38 MiB 4.77 MiB 1.39 MiB
71abba0+dirty 5.15 MiB 6.67 MiB 1.52 MiB
3b6e9f9+dirty 5.15 MiB 6.68 MiB 1.53 MiB
2c735cc+dirty 3.38 MiB 4.74 MiB 1.35 MiB

@github-actions
Copy link
Copy Markdown
Contributor

Android (new) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 424.35 ms 450.88 ms 26.53 ms
Size 48.30 MiB 53.54 MiB 5.24 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
71abba0+dirty 411.04 ms 453.67 ms 42.63 ms
2c735cc+dirty 435.20 ms 459.48 ms 24.28 ms
44c8b3f+dirty 492.13 ms 563.47 ms 71.34 ms
0d9949d+dirty 414.88 ms 428.68 ms 13.81 ms
3b6e9f9+dirty 442.39 ms 486.44 ms 44.05 ms
5c1e987+dirty 444.71 ms 475.13 ms 30.42 ms
4b87b12+dirty 356.23 ms 399.86 ms 43.63 ms
1122a96+dirty 510.16 ms 542.00 ms 31.84 ms
ef27341+dirty 519.02 ms 553.42 ms 34.40 ms
5569641+dirty 465.92 ms 532.22 ms 66.30 ms

App size

Revision Plain With Sentry Diff
71abba0+dirty 48.30 MiB 53.49 MiB 5.19 MiB
2c735cc+dirty 43.94 MiB 48.94 MiB 5.00 MiB
44c8b3f+dirty 48.30 MiB 53.46 MiB 5.15 MiB
0d9949d+dirty 43.94 MiB 48.99 MiB 5.05 MiB
3b6e9f9+dirty 48.30 MiB 53.54 MiB 5.23 MiB
5c1e987+dirty 43.94 MiB 48.94 MiB 5.00 MiB
4b87b12+dirty 43.94 MiB 49.00 MiB 5.06 MiB
1122a96+dirty 48.30 MiB 53.54 MiB 5.24 MiB
ef27341+dirty 48.30 MiB 53.54 MiB 5.24 MiB
5569641+dirty 48.30 MiB 53.48 MiB 5.18 MiB

@github-actions
Copy link
Copy Markdown
Contributor

iOS (new) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 3840.44 ms 1226.02 ms -2614.41 ms
Size 5.15 MiB 6.68 MiB 1.53 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
a50b33d+dirty 1207.11 ms 1212.10 ms 5.00 ms
3d377b5+dirty 1201.55 ms 1201.80 ms 0.25 ms
4b87b12+dirty 1199.49 ms 1199.78 ms 0.29 ms
6176a94+dirty 3854.15 ms 1221.77 ms -2632.38 ms
4966363+dirty 3863.07 ms 1227.19 ms -2635.88 ms
4e0ba9c+dirty 3856.39 ms 1234.44 ms -2621.95 ms
5748023+dirty 3844.74 ms 1225.49 ms -2619.26 ms
44c8b3f+dirty 3849.24 ms 1209.94 ms -2639.31 ms
a5d243c+dirty 3827.92 ms 1220.10 ms -2607.81 ms
8929511+dirty 1223.41 ms 1222.49 ms -0.92 ms

App size

Revision Plain With Sentry Diff
a50b33d+dirty 3.38 MiB 4.73 MiB 1.35 MiB
3d377b5+dirty 3.38 MiB 4.76 MiB 1.38 MiB
4b87b12+dirty 3.38 MiB 4.77 MiB 1.39 MiB
6176a94+dirty 5.15 MiB 6.68 MiB 1.53 MiB
4966363+dirty 5.15 MiB 6.68 MiB 1.53 MiB
4e0ba9c+dirty 5.15 MiB 6.67 MiB 1.51 MiB
5748023+dirty 5.15 MiB 6.68 MiB 1.53 MiB
44c8b3f+dirty 5.15 MiB 6.66 MiB 1.51 MiB
a5d243c+dirty 5.15 MiB 6.68 MiB 1.53 MiB
8929511+dirty 3.38 MiB 4.80 MiB 1.42 MiB

@antonis antonis removed the ready-to-merge Triggers the full CI test suite label May 21, 2026
Comment thread CHANGELOG.md Outdated
Copy link
Copy Markdown
Collaborator

@lucas-zimerman lucas-zimerman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@antonis antonis merged commit b9bebee into main May 21, 2026
59 of 65 checks passed
@antonis antonis deleted the antonis/expose-pause-resume-app-hang-tracking branch May 21, 2026 12:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pause/Resume AppHangs

2 participants